if [[ -z $(pgrep aria2c) ]]; then
    sessionfile="$(pwd)/.aria2-session"
    if [[ ! -f ${sessionfile} ]]; then
        echo "" >${sessionfile}
    fi
    nohup aria2c --enable-rpc --rpc-allow-origin-all=true --rpc-listen-all=true \
        --save-session=${sessionfile} --input-file=${sessionfile} --rpc-secret=asdfg \
        >>aria2c.log 2>&1 &
    echo "start aria2c"
fi

if [[ -z $(pgrep rydownloader) ]]; then
    nohup ./rydownloader >>server.log 2>&1 &
    echo "start rydownloader"
fi
